import { createRouter, createWebHistory } from 'vue-router'

// 路由配置
const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/class',
    name: 'ClassManagement',
    component: () => import('../views/class/ClassManagement.vue'),
    children: [
      {
        path: 'list',
        name: 'ClassList',
        component: () => import('../views/class/ClassList.vue')
      },
      {
        path: 'add',
        name: 'ClassAdd',
        component: () => import('../views/class/ClassForm.vue')
      },
      {
        path: 'edit/:id',
        name: 'ClassEdit',
        component: () => import('../views/class/ClassForm.vue')
      }
    ]
  },
  {
    path: '/course',
    name: 'CourseManagement',
    component: () => import('../views/course/CourseManagement.vue'),
    children: [
      {
        path: 'list',
        name: 'CourseList',
        component: () => import('../views/course/CourseList.vue')
      },
      {
        path: 'add',
        name: 'CourseAdd',
        component: () => import('../views/course/CourseForm.vue')
      },
      {
        path: 'edit/:id',
        name: 'CourseEdit',
        component: () => import('../views/course/CourseForm.vue')
      }
    ]
  },
  {
    path: '/report',
    name: 'ReportAnalysis',
    component: () => import('../views/report/ReportAnalysis.vue'),
    children: [
      {
        path: 'experiment',
        name: 'ExperimentStatistics',
        component: () => import('../views/report/ExperimentStatistics.vue')
      },
      {
        path: 'student',
        name: 'StudentStatistics',
        component: () => import('../views/report/StudentStatistics.vue')
      },
      {
        path: 'visualization',
        name: 'VisualizationChart',
        component: () => import('../views/report/VisualizationChart.vue')
      }
    ]
  },
  {
    path: '/student',
    name: 'StudentManagement',
    component: () => import('../views/student/StudentManagement.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
